using Godot;
using System;

namespace Box {
    public partial class CodeEditWindow : Window
    {
        
        public CodeEditControl EditControl;

        public override void _Ready()
        {
            EditControl = GetNode<CodeEditControl>("CodeEditControl");
            CloseRequested += _onCloseWindow;
        }

        public void Open(Action<string> apply_callback) {
            EditControl.Open(apply_callback);
        }

        public void Open(string file_name) {
            EditControl.Open(file_name);
        }

        public void _onCloseWindow() {
            EditControl._onCancel();
            Hide();
        }

        
    }
}
